package design.action.chain;

/**
 * @author zxs
 * @since 2020/05/26
 */
public class MyImpl2 implements MyInterface{

    private String name;

    private MyInterface next;

    public MyImpl2(String name) {
        this.name = name;
    }

    @Override
    public void doSomething(Param param) {
        System.out.println(name+" do something");
        if(name.equals(param.getName())){
            System.out.println(name+" processed,end");
            return;
        }
        next.doSomething(param);
    }

    @Override
    public void next(MyInterface i){
        this.next=i;
    }
}
